import React, { Component } from 'react'
import {
  BrowserRouter,
  Switch,
  Route,
  NavLink
} from 'react-router-dom'
import Home from './views/Home'
import Classify from './views/Classify'
import Jingxi from './views/Jingxi'
import ShopCar from './views/ShopCar'
import My from './views/My'
import routerConfig from './router/routerConfig'
import RouterView from './router/RouterView'
import RouterLink from './router/RouterLink'

export class App extends Component {
  render() {
    return (
        <BrowserRouter>
        <header></header>
        <main>
          <RouterView routerConfig={routerConfig}></RouterView>
          {/* <Switch>
            <Route path='/home' component={Home}></Route>
            <Route path='/classify' component={Classify}></Route>
            <Route path='/jingxi' component={Jingxi}></Route>
            <Route path='/shopCar' component={ShopCar}></Route>
            <Route path='/my' component={My}></Route>
          </Switch> */}
        </main>
        <footer>
          <RouterLink routerConfig={routerConfig}></RouterLink>
          {/* <NavLink to='/home'>首页</NavLink>
          <NavLink to='/classify'>分类</NavLink>
          <NavLink to='/jingxi'>惊喜</NavLink>
          <NavLink to='/shopCar'>购物车</NavLink>
          <NavLink to='/my'>我的</NavLink> */}
        </footer>
        </BrowserRouter>
    )
  }
}

export default App